package com.zxj.geekstudy.spring;

import lombok.Data;
import lombok.ToString;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Data
@ToString
@Configuration
public class FruitConfig {

    @Resource
    private Apple greenApple;

    @Bean
    public Apple greenApple() {
        Apple apple = new Apple();
        apple.setId(2);
        apple.setName("绿苹果");
        return apple;
    }
}
